package ru.neoflex.chugunov.gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;

import ru.neoflex.chugunov.RateWordsHandler;
import ru.neoflex.chugunov.Word;

public class ActionListenerBtn implements ActionListener {
	RateWordsHandler setRating = new RateWordsHandler();
	private int quality=0;
	Word word;
	ActionListenerBtn(Word word) {		
		this.word = word;		
	}
	@Override
	public void actionPerformed(ActionEvent e) {
		JButton source = (JButton) e.getSource();
		quality = Integer.parseInt(source.getText());
		setRating.setRate(word, quality);
	}
}
